import java.io.IOException;
import java.io.Serializable;
import java.net.ServerSocket;
import java.rmi.server.RMIServerSocketFactory;

import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;

public class MagazineServerSSLFactory implements RMIServerSocketFactory,
		Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2993872764559404060L;

	@Override
	public ServerSocket createServerSocket(int port) throws IOException {
		ServerSocketFactory factory = SSLServerSocketFactory.getDefault();
		SSLServerSocket socket = (SSLServerSocket) factory
				.createServerSocket(port);
		socket.setNeedClientAuth(true);
		return socket;
	}
}
